<%@ page import="com.neuedu.entity.Dept" %>
<%@ page import="java.util.List" %>
<%@ page import="com.neuedu.dao.DeptDao" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2023/11/2
  Time: 14:35
  To change this template use File | Settings | File Templates.
  page 指令
  /web/  --->  webapp
  src/main/webapp/business/dept/dept_list.jsp
  url:   http://localhost:8080/web/business/dept/dept_list.jsp
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%!
	private  int num;
	public void sum(){

	}
%>
<!-- 我是  HTML注释-->

<%--jsp 的 注释--%>
<%--<%=1000%>--%>

<html>
<head>
    <title>Title</title>
</head>
<body>
    <%
		//我是java 注释
		/* 我还是java注释
		***/
        String where  = "  ";
        DeptDao deptDao = new DeptDao();
        List<Dept> depts = deptDao.selectList(where);
    %>


      <a href="http://localhost:8080/web/dept?_type=toAdd">部门添加</a> 
       <table border="1" width="500px"  cellpadding="0" cellspacing="0">
           	<tr align="center">                                                  
               		<td>部门id</td>                                                      
               		<td>部门名称</td>                                                      
               		<td>办公地址</td>                                                      
               		<td>操作</td>                                                      
               	</tr>                                                                  

      <%
			String contextPath = request.getContextPath();
			for (int i = 0; i < depts.size(); i++) {
			Dept dept = depts.get(i);
		  %>
           	<tr align="center">
               		<td> <%= dept.getDeptno()%> </td>
               		<td> <%= dept.getDname()%> </td>
               		<td> <%= dept.getLoc()%> </td>

               		<td>               
                   		  <a href='<%=request.getContextPath()%>/dept?_type=toEdit&deptno=<%=dept.getDeptno()%>'>修改</a>   &nbsp;&nbsp;&nbsp;&nbsp;
                   		  <a href='<%=request.getContextPath()%>/dept?_type=deleteById&deptno=<%=dept.getDeptno()%>'>删除</a>   &nbsp;&nbsp;&nbsp;&nbsp;
                   	   </td>
               	</tr>
		   <%}%></table>



</body>
</html>
